﻿@{
    ViewBag.Title = "编辑Action";
    var action = ViewBag.action as HynuIOTA.Entity.Action;
}
@section headSection
{
    <style>
        .user-form {
            width: 80%;
            margin: 30px auto;
        }

            .user-form div {
                margin: 20px auto;
            }
    </style>
}
@section scripts
{
    <script>
        function doBegin() {
            window.top.$.msgBoxObj.showMsgInfo('数据提交中...');
        }

        function doFail() {
            window.top.$.msgBoxObj.showMsgErr('网络异常!');
        }

        function doComplete(xhrObj) {
            $.processJsonMsg(xhrObj.responseText,
                function(response) {
                    if (response.Statu === 1) {
                        window.top.topHelper.closeComWindow();
                        window.top.topHelper.updateDataGrid();
                    }
                });
        }

        $(function() {
            $('input[name="rMethod"]').combobox({
                panelHeight: 110,
                limitToList: true,
                valueField: 'value',
                textField: 'label',
                data: [
                    {
                        label: '所有方式',
                        value: '*'
                    }, {
                        label: 'GET方式',
                        value: 'get'
                    }, {
                        label: 'POST方式',
                        value: 'post'
                    }
                ]
            });
        });
    </script>
}
<div style="width: 100%">
    @using (Ajax.BeginForm("PutAction", new { area = "Admin", controller = "Permission" }, new AjaxOptions()
    {
        HttpMethod = "Put",
        OnBegin = "doBegin",
        OnFailure = "doFail",
        OnComplete = "doComplete"
    }, new { id = "action-form", name = "action-form" }))
    {
        <div class="user-form">
            <input type="hidden" name="Id" value="@action.Id"/>
            <div><input id="Name" name="Name" value="@action.Name" class="easyui-textbox" data-options="label:'动作名称：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input id="Description" value="@action.Description" name="Description" class="easyui-textbox" data-options="label:'动作描述：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input id="rArea" name="rArea" value="@action.rArea" class="easyui-textbox" data-options="label:'区域名：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input id="rController" name="rController" value="@action.rController" class="easyui-textbox" data-options="label:'控制器名：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input id="rAction" name="rAction" value="@action.rAction" class="easyui-textbox" data-options="label:'Action名：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input id="rMethod" name="rMethod" value="@action.rMethod" data-options="label:'请求方式：',labelPosition:'left',labelWidth:100," style="width: 95%; height: 35px;"></div>
            <div><input type="submit" class="easyui-linkbutton button-blue l-btn l-btn-small" style="width: 95%; height: 40px; margin-left: 5px"/></div>
        </div>
    }
</div>
